﻿<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPageContent.master" AutoEventWireup="false" CodeFile="LPOHdr.aspx.vb" Inherits="Purchase_LPOHdr" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeaderPlaceHolder" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">




    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgLPOHdr">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgLPOHdr" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Office2010Blue"
        Transparency="20">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>


    <br /><br />

    

    <telerik:RadGrid ID="rgLPOHdr" DataSourceID="odsLPOHdr" CellSpacing="0" runat="server"
        AutoGenerateColumns="False" AllowSorting="True"
        AllowPaging="True" GridLines="None" >
        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
        <PagerStyle Mode="NumericPages"></PagerStyle>
        <MasterTableView DataSourceID="odsLPOHdr" CommandItemDisplay="TopAndBottom" DataKeyNames="PurReqID"
            Width="880px" AllowMultiColumnSorting="True" GroupLoadMode="Server" NoMasterRecordsText="<%$ Resources:MainGrid , NoMasterRecordsText %>"
            NoDetailRecordsText="<%$ Resources:MainGrid , NoMasterRecordsText %>" >

    <EditFormSettings>
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
    </EditFormSettings>
            <CommandItemTemplate>
                <table>
                    <tr>
                        <td>
                            <asp:ImageButton ID="ibtnInitInsert" CausesValidation="false" CommandName="Add" runat="server"
                                ImageUrl="~/Design/images/Grid/AddRecord.gif" />
                            <asp:LinkButton ID="lbtnInitInsert" CausesValidation="false" runat="server" Font-Size="14px"
                                Text="<%$ Resources:MainGrid , AddNew %>" Visible="true" CommandName="Add" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnEditSelected" CausesValidation="false" CommandName="Edit"
                                runat="server" ImageUrl="~/Design/images/Grid/Edit.gif" />
                            <asp:LinkButton ID="lbtnEditSelected" CausesValidation="false" runat="server" Font-Size="Medium"
                                Text="<%$ Resources:MainGrid , EditSelected %>" Visible="true" CommandName="Edit" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnDeleteSelected" CausesValidation="false" CommandName="DeleteSelected"
                                OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>" runat="server"
                                ImageUrl="~/Design/images/Grid/Delete.gif" />
                            <asp:LinkButton ID="lbtnDeleteSelected" Font-Size="Medium" CausesValidation="false"
                                OnClientClick="<%$ Resources:MainGrid , OnClientClickDelete %>" runat="server"
                                Text="<%$ Resources:MainGrid , DeleteSelected %>" CommandName="DeleteSelected" />&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:ImageButton ID="ibtnRebindGrid" CausesValidation="false" CommandName="RebindGrid"
                                runat="server" ImageUrl="~/Design/images/Grid/Refresh.gif" />
                            <asp:LinkButton ID="lbtnRebindGrid" Font-Size="Medium" CausesValidation="false" runat="server"
                                Text="<%$ Resources:MainGrid , Refresh %>" CommandName="RebindGrid" />
                            <asp:Literal ID="ltrArabicSpace" meta:ResourceKey="ArabicSpace" runat="server">
                            </asp:Literal>
                        </td>
                    </tr>
                </table>
            </CommandItemTemplate>
    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>

                <telerik:GridBoundColumn SortExpression="LPOID" HeaderButtonType="TextButton" Visible="false"
                     DataField="LPOID" UniqueName="LPOID" >
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn SortExpression="Year" HeaderButtonType="TextButton"
                     DataField="Year" UniqueName="Year" meta:ResourceKey="gbcYear">
                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                   <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridBoundColumn>

                <telerik:GridDateTimeColumn PickerType="DatePicker" SortExpression="EntryDate"
                    DataFormatString="{0:MM/dd/yyyy}" ShowFilterIcon="false"
                    HeaderButtonType="TextButton" DataField="EntryDate" UniqueName="EntryDate"
                    meta:ResourceKey="gbcEntryDate">
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridDateTimeColumn>

                <telerik:GridBoundColumn SortExpression="LPONo" HeaderButtonType="TextButton"
                     DataField="LPONo" UniqueName="LPONo" meta:ResourceKey="gbcLPONo" >
                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                   <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridBoundColumn>
                                
                <telerik:GridDateTimeColumn PickerType="DatePicker" SortExpression="LPODate"
                    DataFormatString="{0:MM/dd/yyyy}" ShowFilterIcon="false"
                    HeaderButtonType="TextButton" DataField="LPODate" UniqueName="LPODate"
                    meta:ResourceKey="gbcLPODate">
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridDateTimeColumn>

                <telerik:GridDropDownColumn DataField="CostCenter" ListTextField="<%$ Resources:SystemResource, lookup %>"
                    SortExpression="CostCenter" UniqueName="CostCenter" Visible="true"
                    DataSourceID="odsCostCenter" ListValueField="MINOR" meta:ResourceKey="gbcCostCenter">
                </telerik:GridDropDownColumn>

                <telerik:GridDropDownColumn DataField="MainCostCenter" ListTextField="<%$ Resources:SystemResource, lookup %>"
                    SortExpression="MainCostCenter" UniqueName="MainCostCenter" Visible="true"
                    DataSourceID="odsMainCostCenter" ListValueField="MINOR" meta:ResourceKey="gbcMainCostCenter">
                </telerik:GridDropDownColumn>

                <telerik:GridDropDownColumn DataField="PurReqID" ListTextField="PurReqNo"
                    SortExpression="PurReqID" UniqueName="PurReqID" Visible="true"
                    DataSourceID="odsPurReq" ListValueField="PurReqID" meta:ResourceKey="gbcPurReqNo">
                </telerik:GridDropDownColumn>

                <telerik:GridBoundColumn SortExpression="DeliveryPlace" HeaderButtonType="TextButton"
                     DataField="DeliveryPlace" UniqueName="DeliveryPlace" meta:ResourceKey="gbcDeliveryPlace" >
                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                   <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridBoundColumn>

                <telerik:GridDropDownColumn DataField="SupplierID" ListTextField="SupplierName"
                    SortExpression="SupplierID" UniqueName="SupplierID" Visible="true"
                    DataSourceID="odsSupplier" ListValueField="SupplierID" meta:ResourceKey="gbcSupplier">
                </telerik:GridDropDownColumn>

                <telerik:GridBoundColumn SortExpression="ImportPeriod" HeaderButtonType="TextButton"
                     DataField="ImportPeriod" UniqueName="ImportPeriod" meta:ResourceKey="gbcImportPeriod" >
                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                   <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridBoundColumn>

                <telerik:GridBoundColumn SortExpression="Remarks" HeaderButtonType="TextButton"
                     DataField="Remarks" UniqueName="Remarks" meta:ResourceKey="gbcRemarks">
                   <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                   <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </telerik:GridBoundColumn>

                </Columns>
        </MasterTableView>
        <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
        </ExportSettings>
        <GroupingSettings CaseSensitive="false" />
        <ClientSettings EnablePostBackOnRowClick="false">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
    </telerik:RadGrid>



    <asp:ObjectDataSource ID="odsLPOHdr" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBLPOHdrSP" DeleteMethod="QueryDatabase" >
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvLPOHdr" Name="Operation" Type="String" />
            <asp:Parameter Name="LPOID" Type="String" />
            <asp:Parameter Name="Year" Type="String" />
            <asp:Parameter Name="EntryDate" Type="String" />
            <asp:Parameter Name="LPONo" Type="String" />
            <asp:Parameter Name="LPODate" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="MainCostCenter" Type="String" />
            <asp:Parameter Name="PurReqID" Type="String" />
            <asp:Parameter Name="DeliveryPlace" Type="String" />
            <asp:Parameter Name="SupplierID" Type="String" />
            <asp:Parameter Name="ImportPeriod" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="DeleteLPOHdr" Name="Operation" Type="String" />
            <asp:Parameter Name="LPOID" Type="String" />
            <asp:Parameter Name="Year" Type="String" />
            <asp:Parameter Name="EntryDate" Type="String" />
            <asp:Parameter Name="LPONo" Type="String" />
            <asp:Parameter Name="LPODate" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="MainCostCenter" Type="String" />
            <asp:Parameter Name="PurReqID" Type="String" />
            <asp:Parameter Name="DeliveryPlace" Type="String" />
            <asp:Parameter Name="SupplierID" Type="String" />
            <asp:Parameter Name="ImportPeriod" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
        </DeleteParameters>
    </asp:ObjectDataSource>



    <asp:ObjectDataSource ID="odsCostCenter" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="odsMainCostCenter" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBlookup_tableSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvMainCostCenter" Name="Operation" Type="String" />
            <asp:Parameter Name="MAJOR" Type="String" />
            <asp:Parameter Name="MINOR" Type="String" />
            <asp:Parameter Name="DescriptionAr" Type="String" />
            <asp:Parameter Name="DescriptionEn" Type="String" />
            <asp:Parameter Name="OrderID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="odsPurReq" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBPurchaseRequestHdrSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvPurchaseRequestHdr" Name="Operation" Type="String" />
            <asp:Parameter Name="PurReqID" Type="String" />
            <asp:Parameter Name="PurReqNo" Type="String" />
            <asp:Parameter Name="PurReqDate" Type="String" />
            <asp:Parameter Name="PurReqType" Type="String" />
            <asp:Parameter Name="CostCenter" Type="String" />
            <asp:Parameter Name="MainCostCenter" Type="String" />
            <asp:Parameter Name="Remarks" Type="String" />
            <asp:Parameter Name="RecordStatus" Type="String" />
            <asp:Parameter Name="LastUpdateBy" Type="String" />
            <asp:Parameter Name="LastUpdateDate" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="odsSupplier" runat="server" SelectMethod="QueryDatabase"
        TypeName="DBSupplierSP">
        <SelectParameters>
            <asp:Parameter DefaultValue="1" Name="QueryType" Type="Object" />
            <asp:Parameter DefaultValue="RtvSupplier" Name="Operation" Type="String" />
            <asp:Parameter Name="SupplierID" Type="String" />
            <asp:Parameter Name="SupplierName" Type="String" />
            <asp:Parameter Name="Mobile" Type="String" />
            <asp:Parameter Name="Tel" Type="String" />
            <asp:Parameter Name="Address" Type="String" />
            <asp:Parameter Name="WebAddress" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
            <asp:Parameter Name="BankID" Type="String" />
            <asp:Parameter Name="BankAccountsID" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

</asp:Content>

